package com.wzxy.ping.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.wzxy.ping.bean.Function;
import com.wzxy.ping.dao.FunctionDao;
import com.wzxy.ping.service.FunctionService;

@Service("functionService")
public class FunctionServiceImpl implements FunctionService{

	@Autowired
	private FunctionDao functionDao;
	
	@Value("${adImage.url}")
	private String adImageUrl;

	@Override
	public List<Function> getFuntionByRole(String role) {
		List<Function> list = functionDao.getFuntionByRole(role);
		for (Function function : list) {
			if(function.getUrlAdree()!=null){
				function.setUrlAdree(adImageUrl+function.getUrlAdree());
			}
		}
		return list;
	}
	
}
